/**
 * jims
 */
package com.jims.master.modules.med.entity;

import com.jims.master.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import java.beans.Transient;

/**
 * 充值Entity
 * @author 陈晓阳
 * @version 2017-05-22
 */
public class MedicalCardRechangeRec extends DataEntity<MedicalCardRechangeRec> {
	
	private static final long serialVersionUID = 1L;
	private String patientId;		// patient_id
	private String cardNo;		// card_no
	private String rechangeMoney;		// 充值金额
	private String rechangeType;		// 充值方式 0 现金 1 微信 3 银行卡
	private String balance;		// 余额
	private String rcptNo;		// 收据号
	private String expand1;		// expand1
	private String expand2;		// expand2
	private String expand3;		// expand3
//	private String orgId;		// 机构ID
    private String startTime;
    private String endTime;
    private Integer rcptsNum;
    private double sumAmount;
    private String acctNo;
    private String rechangeFlag;
    private String name;



    public String getAcctNo() {
        return acctNo;
    }

    public void setAcctNo(String acctNo) {
        this.acctNo = acctNo;
    }

    public Integer getRcptsNum() {
        return rcptsNum;
    }

    public void setRcptsNum(Integer rcptsNum) {
        this.rcptsNum = rcptsNum;
    }

    public double getSumAmount() {
        return sumAmount;
    }

    public void setSumAmount(double sumAmount) {
        this.sumAmount = sumAmount;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public MedicalCardRechangeRec() {
		super();
	}

	public MedicalCardRechangeRec(String id){
		super(id);
	}

	@Length(min=1, max=64, message="patient_id长度必须介于 1 和 64 之间")
	public String getPatientId() {
		return patientId;
	}

	public void setPatientId(String patientId) {
		this.patientId = patientId;
	}
	
	@Length(min=1, max=64, message="card_no长度必须介于 1 和 64 之间")
	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}
	
	public String getRechangeMoney() {
		return rechangeMoney;
	}

	public void setRechangeMoney(String rechangeMoney) {
		this.rechangeMoney = rechangeMoney;
	}
	
	@Length(min=1, max=11, message="充值方式 0 现金 1 微信 3 银行卡长度必须介于 1 和 11 之间")
	public String getRechangeType() {
		return rechangeType;
	}

	public void setRechangeType(String rechangeType) {
		this.rechangeType = rechangeType;
	}
	
	public String getBalance() {
		return balance;
	}

	public void setBalance(String balance) {
		this.balance = balance;
	}
	
	@Length(min=1, max=64, message="收据号长度必须介于 1 和 64 之间")
	public String getRcptNo() {
		return rcptNo;
	}

	public void setRcptNo(String rcptNo) {
		this.rcptNo = rcptNo;
	}
	
	@Length(min=0, max=64, message="expand1长度必须介于 0 和 64 之间")
	public String getExpand1() {
		return expand1;
	}

	public void setExpand1(String expand1) {
		this.expand1 = expand1;
	}
	
	@Length(min=0, max=64, message="expand2长度必须介于 0 和 64 之间")
	public String getExpand2() {
		return expand2;
	}

	public void setExpand2(String expand2) {
		this.expand2 = expand2;
	}
	
	@Length(min=0, max=64, message="expand3长度必须介于 0 和 64 之间")
	public String getExpand3() {
		return expand3;
	}

	public void setExpand3(String expand3) {
		this.expand3 = expand3;
	}


    @Transient
    public String getType(){
        if(this.getRechangeMoney()!=null&&!"".equals(this.getRechangeType())){
            if(Double.parseDouble(this.rechangeMoney)>0){
                return "充值";
            }else{
                return "退卡";
            }
        }else{
            return "";
        }
    }

    public String getRechangeFlag() {
        return rechangeFlag;
    }

    public void setRechangeFlag(String rechangeFlag) {
        this.rechangeFlag = rechangeFlag;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}